from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    #搜索
    def sosuo(self):
        #android uiautomator
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.RelativeLayout").instance(3)')
        ele=self.find_ele(loc)
        return ele
    #输入搜索内容
    def srnr(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    #点击搜索
    def djss(self):
        loc=(By.ID,'com.achievo.vipshop:id/tv_search')
        ele=self.find_ele(loc)
        return ele
    #点击图片
    def djtp(self):
        loc=(By.XPATH,'(//android.widget.RelativeLayout[@resource-id="com.achievo.vipshop:id/image_main_layout"])[1]/android.widget.FrameLayout')
        ele=self.find_ele(loc)
        return ele
    #点击收藏
    def djsc(self):
        loc=(By.ID,'com.achievo.vipshop:id/img')
        ele=self.find_ele(loc)
        return ele
    #点击返回
    def djfh(self):
        loc=(By.ID,'com.achievo.vipshop:id/btn_round_back_icon')
        ele=self.find_ele(loc)
        return ele
    #断言
    def xiaoliang(self):
        loc=(By.ID,'com.achievo.vipshop:id/text_sales_volume')
        ele=self.find_ele(loc)
        return ele
    # 断言
    def whggaq(self):
         loc = (By.CLASS_NAME, 'android.widget.TextView')
         ele = self.find_ele(loc)
         return ele
    #再次返回
    def zcfh(self):
    #accessibility id
        loc = (By.ACCESSIBILITY_ID, '返回')
        ele = self.find_ele(loc)
        return ele